package com.example.cny.activity;

import android.graphics.Color;
import android.widget.TextView;

import com.example.cny.R;
import com.example.cny.presenter.RegisterPresenter;
import com.example.mylibrary.base.BaseActivity;
import com.example.mylibrary.base.BaseNoDaggerActivity;
import com.example.mylibrary.di.component.BaseComponent;
import com.lljjcoder.citypickerview.widget.CityPicker;

import butterknife.BindView;

public class CompleteCityActivity extends BaseNoDaggerActivity {
    @BindView(R.id.register_btn)
    TextView registerCityBtn;

    @Override
    protected int getLayoutRes() {
        return R.layout.activity_complete_city;
    }

    @Override
    protected void initData() {
//        registerCityBtn.setOnClickListener(this);
    }

    private void selectAddress() {
        CityPicker cityPicker = new CityPicker.Builder(this)
                .textSize(14)
//                .title("地址选择")
                .titleBackgroundColor("#FFFFFF")
//                .ti("#696969")
                .confirTextColor("#696969")
                .cancelTextColor("#696969")
                .province("江苏省")
                .city("常州市")
                .district("天宁区")
                .textColor(Color.parseColor("#000000"))
                .provinceCyclic(true)
                .cityCyclic(true)
                .districtCyclic(false)
                .visibleItemsCount(5)
                .itemPadding(10)
                .onlyShowProvinceAndCity(false)
                .build();
        cityPicker.show();
        //监听方法，获取选择结果
        cityPicker.setOnCityItemClickListener(new CityPicker.OnCityItemClickListener() {
            @Override
            public void onSelected(String... citySelected) {
                //省份
                String province = citySelected[0];
                //城市
                String city = citySelected[1];
                //区县（如果设定了两级联动，那么该项返回空）
                String district = citySelected[2];
                //邮编
                String code = citySelected[3];
                //为TextView赋值
                registerCityBtn.setText(province.trim() + "-" + city.trim() + "-" + district.trim());
            }
        });
    }
}
